home *** CD-ROM | disk | FTP | other *** search
- Path: usenet.ufl.edu!usenet
- From: Michael Ellis <michael@anest4.anest.ufl.edu>
- Newsgroups: comp.sys.cbm,comp.os.misc,alt.comp.hardware.homebuilt,comp.sys.apple2,comp.sys.apple2.programmer,comp.sys.atari.8bit
- Subject: Re: 6502 Multitasking OS announce
- Date: 18 Mar 1996 14:52:30 GMT
- Organization: University Of Florida
- Message-ID: <4ijtbe$7ca@no-names.nerdc.ufl.edu>
- References: <4i94fs$stj@narses.hrz.tu-chemnitz.de> <holger.948.00030EE6@deep.hb.provi.de>
- NNTP-Posting-Host: greenwolf.anest.ufl.edu
- Mime-Version: 1.0
- Content-Type: text/plain; charset=us-ascii
- Content-Transfer-Encoding: 7bit
- X-Mailer: Mozilla 1.1N (Windows; I; 16bit)
-
- holger@deep.hb.provi.de (Holger Bruns) wrote:
-
- >An operating system for the 6502 should have some of the properties of CPM.
- >Parameters could be passed into registers and some zeropage locations.
- >The operating system should be invoked with the BRK instruction. This was my
- >latest idea. But it seems so far, I am to late. I do not know, if your system
- >works in this way, Andre. I have not seen your code until now. But you have
- >done the job. My congratulations.
- >
-
- There are two problems with the above:
-
- 1) Passing parameters via registers is not such a great idea on the 6502 because,
- as you know, there are only three of them. It's very difficult to convery
- any amount of information in 24 total bits of data. At best you get on address
- and one byte of data. Not enough really.
-
-
- 2) Passing parameters via zero page has problems with the fact that your code will
- NOT be reentrant. If you propose to do ANY multitasking whatsoever, you must
- write reentrant code. If you don't, the following will happen:
-
- 1. parameters are installed and program jumps to routine
-
- 2. timer interrupt comes in and invokes the dispatcher which then
- decides to give time to another task
-
- 3. other task determines that the same work needs to be done calls the
- routine of step 1
-
- 4. the routine completes and the processor returns to the original task
-
- 5. the original task pulls its parameters out of ram only to find that
- they were corrupted by the last task who stored its parameters in the
- some block of RAM.
-
- The way to get around this is to pass all parameters on the stack, and use separate
- stacks for the separate tasks.
-
-
- Hope this helps...
-
- Michael Ellis
-
-
-
-